package com.dwxt.sport.business.entity;

import com.dwxt.sport.util.DictUtil;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.time.LocalDateTime;

@Data
@Accessors(chain = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
@Table(name = "t_adolescent_sports_health_equipment")
public class AdolescentSportsHealthEquipment {

    @Id
    private String id;

    /**
     * 青少年运动健康关联id
     */
    @Column(name = "health_id")
    private String healthId;

    /**
     * 设备id
     */
    @Column(name = "equipment_id")
    private String equipmentId;

    /**
     * 累计人次
     */
    @Column(name = "cumulative_person")
    private Integer cumulativePerson;

    /**
     * 平均人次
     */
    @Column(name = "average_people")
    private Integer avg;

    /**
     * 今日人次
     */
    @Column(name = "today_people")
    private Integer todayPeople;

    /**
     * 使用总时长(单位:min)
     */
    @Column(name = "total_usage_time")
    private Integer totalUsageTime;

    /**
     * 备注
     */
    private String remark;

    /**
     * 设备状态
     */
    @Column(name = "device_status")
    private String deviceStates;

    @ApiModelProperty("设备状态Display")
    public String getDeviceStatesDisplay(){
        return deviceStates!=null? DictUtil.getDisplay("deviceState",deviceStates):null;
    }

    /**
     * 逻辑删除标识(0否1是)
     */
    @Column(name = "is_delete")
    private String isDelete;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    @ApiModelProperty("(创建时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @Column(name = "create_user_id")
    private String createUserId;

    /**
     * (最近)更新时间
     */
    @Column(name = "update_time")
    @ApiModelProperty("(最近)更新时间")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private LocalDateTime updateTime;

    /**
     * 更新人id
     */
    @Column(name = "update_user_id")
    private String updateUserId;

    /**
     * 备用字段1
     */
    private String attr1;

    /**
     * 备用字段2
     */
    private String attr2;

    /**
     * 备用字段3
     */
    private String attr3;

    /**
     * 备用字段4
     */
    private String attr4;

}